<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/ionicons/css/ionicons.min.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/iCheck/square/blue.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/morris/morris.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/jvectormap/jquery-jvectormap-1.2.2.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/datepicker/datepicker3.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/daterangepicker/daterangepicker.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/datatables/dataTables.bootstrap.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/treeTable/jquery.treetable.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/treeTable/jquery.treetable.theme.default.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/select2/select2.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/colorpicker/bootstrap-colorpicker.min.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/bootstrap-markdown/css/bootstrap-markdown.min.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/adminLTE/css/AdminLTE.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/adminLTE/css/skins/_all-skins.min.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/css/style.css">
<link rel="stylesheet"
	href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">

<script src="https://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>
<script
	src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/web-flower.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>好好鲜花店-网上鲜花店十大排名,本地鲜花店配送,花店专注鲜花预定/网上送花服务</title>
</head>
<body>
	<div class="right">
		<div class="top">
			<span class="glyphicon glyphicon-home icon"></span> <a href="${pageContext.request.contextPath}/web/index">你好，欢迎来到好好鲜花店，中国网上花店领先品牌！</a>
			<div class="top-right">
			<c:if test='${user == null}'><a href="${pageContext.request.contextPath}/pages/web-register.jsp">注册</a> | 
										<a href="${pageContext.request.contextPath}/pages/web-login-car.jsp?id=${flower.id}">登录</a> </c:if>
			<c:if test='${user != null}'><a>欢迎你，${user.username}</a><a id="user_input">${user.id}</a>  | <a href="${pageContext.request.contextPath}/web/index">注销</a> </c:if>
				 
			</div>
		</div>
		<div>
			<a href="${pageContext.request.contextPath}/web/index">
			<img src="${pageContext.request.contextPath}/images/top.png" class="img-responsive"></a>
		</div>
		<div class="logo-search">
			<div class="logo">
				<a href="${pageContext.request.contextPath}/web/index">
				<img src="${pageContext.request.contextPath}/images/logo.png" class="img-responsive" /></a>
			</div>
			<div class="search">
				<label for="name" class="search-top">商品</label>
				<div class="input-group">
					<input type="text" class="form-control"
						placeholder="请你要查找鲜花的名称，如：玫瑰花"> <span
						class="input-group-btn">
						<button class="btn btn-danger" type="button">搜 索</button>
					</span>
				</div>
				<div class="hot-search">
					<span>热门搜索 : </span> <span><a>送闺蜜</a></span> <span><a>送老婆</a></span>
					<span><a>送领导</a></span> <span><a>送妈妈</a></span> <span><a>送女友</a></span>
					<span><a>开业送花</a></span>
				</div>
			</div>
		</div>
		<div class="navs">
			<div>
				<ul>
					<li class="navs-left"><span class="glyphicon glyphicon-list"></span>
						<a>全部商品分类</a></li>
					<li><a>首页</a></li>
					<li><a>全部鲜花</a></li>
					<li><a>绿植发财树</a></li>
					<li><a>永生花</a></li>
					<li><a>韩式鲜花</a></li>
					<li><a>开业花篮</a></li>
					<li><a>生日蛋糕</a></li>
				</ul>
			</div>
		</div>
	</div>
	<div  class="flower">
		<div class="image">
			<img alt="" src="${pageContext.request.contextPath}/img/flower/${flower.photo }">
		</div>
		<div class="describe">
			<div class="tito">${flower.flowername }</div>
			<div class="details">
				<table>
					<tr><td>材料：</td>
					<td>${flower.material }<a id="flowerId">${flower.id}</a></td></tr>
					<tr><td>包装：</td>
					<td>${flower.packing }</td></tr>
					<tr><td>花语：</td>
					<td>${flower.flowerlanguage }</td></tr>
					<tr><td>附送：</td>
					<td>免费附送精美贺卡，代写您的祝福。(您下单时可填写留言栏)</td></tr>
					<tr><td>配送：</td>
					<td>本地区各市县、乡镇、街道（市区内免费配送）</td></tr>
					<tr><td>说明：</td>
					<td>由于鲜花包扎各地的花艺师不同，可能在花束的形式和搭配上与图片不完全一致，但我们保证鲜花的主花材品种、新鲜程度、数量、颜色与说明一致，谢谢。</td></tr>
				</table>
			</div>
			<div class="button">
				<div class="price">价格 ：<span>¥${flower.price}</span><p>库存：${flower.total}</p></div>
				<div class="quantati">
					<input type="number" min="1" value="1" max="${flower.total}" id="quantity"/>
					<c:if test='${user != null}'>	
						<button class="button-buy" onclick="buy()">
								<span class="glyphicon glyphicon-shopping-cart"></span> 立即购买
						</button></c:if>
							<c:if test='${user == null}'> <button class="button-buy" onclick="alert('请先登录')">
							<span class="glyphicon glyphicon-shopping-cart"></span> 立即购买</button></c:if>
					
					<c:if test='${user != null}'>	
						<button class="button-car">
							<a href="${pageContext.request.contextPath}/buy/car?flowersId=${flower.id}&userId=${user.id}">加入购物车</a>
							</button></c:if>
							<c:if test='${user == null}'> <button   class="button-car"><a href="" onclick="alert('请先登录')">加入购物车</a></button></c:if>
				</div>
			</div>
		</div>
	</div>
	<div class="left">
			<img src="${pageContext.request.contextPath}/images/default_user_portrait.gif" class="img-circle">
			<c:if test='${user != null}'><a href="${pageContext.request.contextPath}/show/car?userId=${user.id}">购<br>物<br>车<br></a></c:if>
			<c:if test='${user == null}'><a href="" onclick="alert('请先登录')">购<br>物<br>车<br></a></c:if>
	</div>
</body>
	<script type="text/javascript">
	$(document).ready(function() {
		$("#user_input").hide();
		$("#flowerId").hide();
		});
	function buy() {
		var quantity = $('#quantity').val();
		var userId=$('#user_input').html();
		var flowerId=$("#flowerId").html();
		console.log(quantity+" "+flowerId+" "+userId);
		window.location.href ="${pageContext.request.contextPath}/buy/carflower?flowerId="+flowerId+"&userId="+userId+"&quantity="+quantity;
			
	}
	</script>
	<script
		src="${pageContext.request.contextPath}/plugins/jQuery/jquery-2.2.3.min.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/jQueryUI/jquery-ui.min.js"></script>
	<script>
		$.widget.bridge('uibutton', $.ui.button);
	</script>
	<script
		src="${pageContext.request.contextPath}/plugins/bootstrap/js/bootstrap.min.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/raphael/raphael-min.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/morris/morris.min.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/sparkline/jquery.sparkline.min.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/knob/jquery.knob.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/daterangepicker/moment.min.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/daterangepicker/daterangepicker.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/daterangepicker/daterangepicker.zh-CN.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/datepicker/bootstrap-datepicker.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/datepicker/locales/bootstrap-datepicker.zh-CN.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/slimScroll/jquery.slimscroll.min.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/fastclick/fastclick.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/iCheck/icheck.min.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/adminLTE/js/app.min.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/treeTable/jquery.treetable.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/select2/select2.full.min.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/colorpicker/bootstrap-colorpicker.min.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/bootstrap-wysihtml5/bootstrap-wysihtml5.zh-CN.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/bootstrap-markdown/js/bootstrap-markdown.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/bootstrap-markdown/locale/bootstrap-markdown.zh.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/bootstrap-markdown/js/markdown.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/bootstrap-markdown/js/to-markdown.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/ckeditor/ckeditor.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/input-mask/jquery.inputmask.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/input-mask/jquery.inputmask.date.extensions.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/input-mask/jquery.inputmask.extensions.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/datatables/jquery.dataTables.min.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/datatables/dataTables.bootstrap.min.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/chartjs/Chart.min.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/flot/jquery.flot.min.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/flot/jquery.flot.resize.min.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/flot/jquery.flot.pie.min.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/flot/jquery.flot.categories.min.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/ionslider/ion.rangeSlider.min.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/bootstrap-slider/bootstrap-slider.js"></script>
	<script>
		$(document).ready(function() {
			// 选择框
			$(".select2").select2();

			// WYSIHTML5编辑器
			$(".textarea").wysihtml5({
				locale : 'zh-CN'
			});
		});

		// 设置激活菜单
		function setSidebarActive(tagUri) {
			var liObj = $("#" + tagUri);
			if (liObj.length > 0) {
				liObj.parent().parent().addClass("active");
				liObj.addClass("active");
			}
		}

		$(document).ready(function() {
			// 激活导航位置
			setSidebarActive("admin-index");
		});
	</script>
</html>